import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:hook_rent/pages/home/tab_search/data_list.dart';
import 'package:hook_rent/widgets/image_widget.dart';
import 'package:hook_rent/widgets/tag_widget.dart';

class RoomListItemWidget extends StatelessWidget {
  final RoomListItemData data;
  const RoomListItemWidget(this.data, {super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.only(left: 10.w, right: 10.w, bottom: 10.w),
      child: Row(
        children: [
          ImageWidget(
            data.imageUrl,
            width: 132.5.w,
            height: 100.h,
          ),
          10.horizontalSpace,
          Expanded(
              child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Text(
                data.title,
                maxLines: 1,
                overflow: TextOverflow.ellipsis,
                style: const TextStyle(fontWeight: FontWeight.w600),
              ),
              Text(
                data.subTitle,
                maxLines: 1,
                overflow: TextOverflow.ellipsis,
              ),
              Wrap(
                children: data.tags.map((item) => TagWidget(item)).toList(),
              ),
              Text(
                "${data.price}元/月",
                style: TextStyle(
                  color: Colors.red,
                  fontSize: 14.sp,
                  fontWeight: FontWeight.w600,
                ),
              ),
            ],
          ))
        ],
      ),
    );
  }
}
